#include "qmath.h"

#include <cmath>

QNamespaceStart(Qui)

bool QRectIntersection(QSize_t rect_1, QSize_t rect_2)
{
	QGeomtery_t geom_1 = QSize2QGemotery(rect_1);
	QGeomtery_t geom_2 = QSize2QGemotery(rect_2);

	int zx = abs(geom_1.x1 + geom_1.x2 - geom_2.x1 - geom_2.x2);
	int  x = abs(geom_1.x1 - geom_1.x2) + abs(geom_2.x1 - geom_2.x2);

	int zy = abs(geom_1.y1 + geom_1.y2 - geom_2.y1 - geom_2.y2);
	int  y = abs(geom_1.y1 - geom_1.y2) + abs(geom_2.y1 - geom_2.y2);

	if (zx <= x && zy <= y)
	{
		return true;
	}

	return false;
}



QNamespaceEnd